package com.ssy.lingxi.platform.manage.handler.init;

import com.ssy.lingxi.platform.manage.service.ISensitiveWordService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 服务启动时构建敏感词字典
 * @author yzc
 * @version 2.0.0
 * @date 2020/11/11
 */
@Slf4j
@Data
@Component
public class SensitiveWordHandler implements ApplicationRunner {

    @Resource
    private ISensitiveWordService sensitiveWordService;

    @Override
    public void run(ApplicationArguments args) {
        sensitiveWordService.initSensitiveWord();

        log.info("sensitiveWord init finished...");
    }
}
